import request from '@/utils/request'

// 查询订单主表列表
export function listOrders(query) {
    return request({
        url: '/dashboard/orders/list',
        method: 'get',
        params: query
    })
}

// 给予微信小程序任务列表
export function wechatTaskList(query) {
    return request({
        url: '/dashboard/orders/wechatTaskList',
        method: 'get',
        params: query
    })
}

// 查询订单主表详细
export function getOrders(id) {
    return request({
        url: '/dashboard/orders/' + id,
        method: 'get'
    })
}

// 新增订单主表
export function addOrders(data) {
    return request({
        url: '/dashboard/orders',
        method: 'post',
        data: data
    })
}

// 修改订单主表
export function updateOrders(data) {
    return request({
        url: '/dashboard/orders',
        method: 'put',
        data: data
    })
}

// 删除订单主表
export function delOrders(id) {
    return request({
        url: '/dashboard/orders/' + id,
        method: 'delete'
    })
}

// 上传订单需求文档
export function uploadOrderRequirement(data) {
    return request({
        url: '/dashboard/orders/requirement/upload',
        method: 'post',
        data: data
    })
}

// 上传订单附件
export function uploadOrderAttachment(data) {
    return request({
        url: '/dashboard/orders/attachment/upload',
        method: 'post',
        data: data
    })
}

// 获取订单需求文档列表
export function listOrderRequirements(orderId) {
    return request({
        url: '/dashboard/requirements/list/' + orderId,
        method: 'get'
    })
}

// 获取订单附件列表
export function listOrderAttachments(orderId) {
    return request({
        url: '/dashboard/attachments/list/' + orderId,
        method: 'get'
    })
}

// 新增退款
export function addRefund(data) {
    return request({
        url: '/dashboard/refund',
        method: 'post',
        data: data
    })
}

// 获取所有技术等级列表
export function listAllSkillLevels() {
    return request({
        url: '/dashboard/levels/all',
        method: 'get'
    })
}
